<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="logout">退出账号</button>
</body>
</html>

<script src="/jscode/js/tools.js"></script>
<script>
    (() => {
        let business = localStorage.getItem('business') ? JSON.parse(localStorage.getItem('business')) : '';

        if(!business)
        {
            Module.notice('请先登录','5.html');

            return false;
        }

        console.log(business.id);
    })();

    let logout = document.getElementById('logout');

    logout.onclick = function()
    {
        let result = confirm('是否确认退出当前账号');

        if(result === false)
        {
            return false;
        }

        // 删除指定本地存储
        localStorage.removeItem('business');

        Module.notice('退出账号成功','5.html');
    }
</script>